package com.supermarket.job;

import com.supermarket.service.DashboardService;
import lombok.RequiredArgsConstructor;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.springframework.stereotype.Component;

@Component
@RequiredArgsConstructor
public class DashboardDataJob {

    private final DashboardService dashboardService;

    @XxlJob("dashboardDataJob")
    public void execute() {
        // 刷新或重新缓存仪表板数据
        dashboardService.getDashboardData();
        System.out.println("仪表板数据已刷新");
    }
}
